<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/7/27 0027
 * Time: 10:32
 */

namespace app\api\controller\v1\agent;


use app\api\controller\v1\Agent;
use app\currency\service\AgentService;

class Home extends Agent
{
    public function index()
    {
        $ids = AgentService::getTeamIds($this->aid);
        $team_count = count($ids);
        $result = [
            'id' => $this->aid,
            'balance' => $this->agent->balance + 0,
            'team_count' => $team_count,
            'name' => $this->agent->name,
            'wechat_qrcode' => sysconf('wechat_qrcode'),
            'customer_service_telephone_numbers' => sysconf('customer_service_telephone_numbers') ?: '',
        ];
        $this->success('success',$result);
    }
}